package com.marvels.financial.loan.service.impl;

import java.util.List;

import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.marvels.common.exception.MarvelsBusinessException;
import com.marvels.common.utils.MarvelsLogUtil;
import com.marvels.financial.loan.dao.McfeSustainBankListMapper;
import com.marvels.financial.loan.dto.McfeSustainBankListDTO;
import com.marvels.financial.loan.service.BankLimitRelevantApi;

import net.sf.json.JSONObject;

/**
 *	银行限额相关
 * @author 唐佩文
 *
 */
@Service
public class BankLimitRelevantImpl implements BankLimitRelevantApi{

	@Autowired
	private McfeSustainBankListMapper mcfeSustainBankListMapper;
	
	@Override
	public List<McfeSustainBankListDTO> selectByBankName(McfeSustainBankListDTO record) throws MarvelsBusinessException{
		MarvelsLogUtil.getInstance().info(">>>>银行名称:"+record.getBankName()+"查询银行名称支持");
		if(StringUtils.isEmpty(record.getBankName())){
			throw new MarvelsBusinessException("银行名称不能为空");
		}
		List<McfeSustainBankListDTO> list=mcfeSustainBankListMapper.selectByBankName(record);
		MarvelsLogUtil.getInstance().info(">>>>银行名称:"+record.getBankName()+"查询银行名称支持返回结果:"+JSONObject.fromObject(list));
		return list;
	}

	@Override
	public List<McfeSustainBankListDTO> selectSustainBankList() throws MarvelsBusinessException{
		List<McfeSustainBankListDTO> list=mcfeSustainBankListMapper.selectSustainBankList();
		return list;
	}

}
